/**
 * 
 */
package org.springyu.codegenerator.model;

import java.io.Serializable;

/**
 * @author springyu
 *类Column.java的实现描述： 列对象，如同表结构的列 
 */
public class Column  implements Serializable{
	
	  /**
	 * TabStructure
	 */
	private static final long serialVersionUID = 1L;
	/**
     * 列名称
     */
    private String name;
    /**
     * 属性名
     */
    private String attrName;
    /**
     * 列备注
     */
    private String comment;
    
    /**
     * 是否主键
     */
    private Boolean isKey = Boolean.FALSE;
    /**
     * 是否为外键
     */
    private Boolean isForeign = Boolean.FALSE;
    /**
	 * @return the isForeign
	 */
	public Boolean getIsForeign() {
		return isForeign;
	}

	/**
	 * @param isForeign the isForeign to set
	 */
	public void setIsForeign(Boolean isForeign) {
		this.isForeign = isForeign;
	}

	/**
     * 是否为空
     */
    private Boolean isNotNull;
    /**
     * 是否惟一
     */
    private Boolean isUnique;
    /**
     * 数据库中长度
     */
	public int sqlColumnLength;
	/**
	 * 精度 浮点型才有
	 */
	public int sqlDecimalLength;

    /**
     * 列类型,目前都当字符串类型，有其他类型的需求时再做升级
     */
    private Class   dataType= String.class;
 

    /**
     * 构造函数
     * 
     * @param name 列名称
     */
    public Column(String name){
        this.name = name;
  
    }

    /**
     * 构造函数
     * 
     * @param name 列名称
     * @param type 列类型
     */
    public Column(String name, Class type){
        this.name = name;
        this.dataType = type;
    }

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the attrName
	 */
	public String getAttrName() {
		return attrName;
	}

	/**
	 * @param attrName the attrName to set
	 */
	public void setAttrName(String attrName) {
		this.attrName = attrName;
	}

	/**
	 * @return the comment
	 */
	public String getComment() {
		return comment;
	}

	/**
	 * @param comment the comment to set
	 */
	public void setComment(String comment) {
		this.comment = comment;
	}

	/**
	 * @return the isKey
	 */
	public Boolean getIsKey() {
		return isKey;
	}

	/**
	 * @param isKey the isKey to set
	 */
	public void setIsKey(Boolean isKey) {
		this.isKey = isKey;
	}

	/**
	 * @return the isNotNull
	 */
	public Boolean getIsNotNull() {
		return isNotNull;
	}

	/**
	 * @param isNotNull the isNotNull to set
	 */
	public void setIsNotNull(Boolean isNotNull) {
		this.isNotNull = isNotNull;
	}

	/**
	 * @return the isUnique
	 */
	public Boolean getIsUnique() {
		return isUnique;
	}

	/**
	 * @param isUnique the isUnique to set
	 */
	public void setIsUnique(Boolean isUnique) {
		this.isUnique = isUnique;
	}

	/**
	 * @return the sqlColumnLength
	 */
	public int getSqlColumnLength() {
		return sqlColumnLength;
	}

	/**
	 * @param sqlColumnLength the sqlColumnLength to set
	 */
	public void setSqlColumnLength(int sqlColumnLength) {
		this.sqlColumnLength = sqlColumnLength;
	}

	/**
	 * @return the sqlDecimalLength
	 */
	public int getSqlDecimalLength() {
		return sqlDecimalLength;
	}

	/**
	 * @param sqlDecimalLength the sqlDecimalLength to set
	 */
	public void setSqlDecimalLength(int sqlDecimalLength) {
		this.sqlDecimalLength = sqlDecimalLength;
	}

	/**
	 * @return the dataType
	 */
	public Class getDataType() {
		return dataType;
	}

	/**
	 * @param dataType the dataType to set
	 */
	public void setDataType(Class dataType) {
		this.dataType = dataType;
	}
    
    

}
